<template>
  <view class="su-svg-icon">
    <text v-if="!iconfont" :class="[className,'menu-iconfont','micon-'+iconClass]" :style="{'font-size':size}"></text>
    <text v-else :class="[className,'iconfont',iconClass]" :style="{'font-size':size}"></text>
  </view>
</template>

<script>
export default {
  name: 'su-svg-icon',
  props: {
    iconfont:{
      type:Boolean,
      default:false
    },
    iconClass: {
      type: String,
      required: true
    },
    className: {
      type: String,
      default: ''
    },
    size:{
      type:String,
      default:'inherit'
    }
  },
  computed: {
  }
}
</script>

<style lang="scss" scoped>
  // 引入字体图标
  @import "@/static/styles/iconfont.css";
  .su-svg-icon{
    text{
      display: block;
    }
  }
</style>
